<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>文本框之图标 - jQuery EasyUI 演示</title>
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">
	<script type="text/javascript" src="../../jquery.min.js"></script>
	<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
</head>
<body>
	<h2 title="TextBox with Icons">文本框之图标</h2>
	<p title="Click the icons on textbox to perform actions.">　　点击文本框上的图标即可执行相应的操作。</p>
    <div style="margin:0px 0 10px 0">
        <span>选择图标的对齐方式：</span>
        <select onchange="$('#tt').textbox({iconAlign:this.value})">
            <option value="right">右对齐</option>
            <option value="left">左对齐</option>
        </select>
    </div>
	<div class="easyui-panel" style="width:100%;max-width:400px;padding:20px 20px;">
		<div style="margin-bottom:10px">
			<input id="tt" class="easyui-textbox" style="width:100%;" data-options="
					label: '图标：', labelPosition: 'left', labelWidth:50, labelAlign:'right',
					prompt: '在此输入值！', iconWidth: 22,
					icons: [{
						iconCls:'icon-add',
						handler: function(e){
							$(e.data.target).textbox('setValue', '预置的值已被载入！');
						}
					},{
						iconCls:'icon-remove',
						handler: function(e){
							$(e.data.target).textbox('clear');
						}
					},{
						iconCls:'icon-search',
						handler: function(e){
							var v = $(e.data.target).textbox('getValue');
							alert(v ? ('你刚才输入的值为： '+v) : '无任何输入！');
						}
					}]
					">
		</div>
	</div>
</body>
</html>